home *** CD-ROM | disk | FTP | other *** search
- /*
- FILENAME
- GlobalData.h
-
- DESCRIPTION
- Contains code that shows a prefered way to manage unique global
- data for different message handler instances. This method
- stores all globals off of the message manager instance context.
- It has the advantage that it will work under any compiler.
- This method is documented in detail in "Inside Macintosh: GX
- Environment & Utilities" starting on page 6-10
-
- COPYRIGHT
- Copyright © 1995 Apple Computer, Inc.
- All rights reserved.
-
- Modification history
- 10/04/95 - David Hayward - Version 1.0.4 modified code so that
- the driver can be build under MPW,
- Metrowerks, and Symantec. In general,
- all that was required to do this was
- to add an inline-assembly jumptable
- and to store all globals off of the
- message manager instance context.
- Also made a few changes so that the
- driver can be rebuilt to support any
- resolution by changing the #defines
- kResolution and kPatStretch in
- "CommonDefines.h"
-
- 10/03/95 - David Hayward - Begat.
- */
-
-
- #include <Types.h>
- #include <Files.h>
- #include <QuickDraw.h>
- #include <GXPrinterDrivers.h>
- #include <GXPrinting.h>
-
-
- // Our buffer description
-
- typedef struct
- {
- Boolean bufferIsDirty; // Is this buffer dirty (is there data to be written out)?
- char padByte;
- long curOffset; // where's the next byte go in this buffer?
- gxPrintingBuffer **printBuffer; // The buffers themselves.
- } BufferEntry, *BufferEntryPtr, **BufferEntryHdl;
-
-
- // our buffer group description-- a collection of BufferEntry records plus info.
-
- typedef struct
- {
- short numBuffers; // number of buffers
- long bufferSize; // and their sizes.
- short curBuff; // current buffer we're writing to.
- BufferEntry buff[1]; // individual buffer records.
- } BufferGroup, *BufferGroupPtr, **BufferGroupHdl;
-
-
- // Our global data structure
-
- typedef struct
- {
- long temp; // accumulated lines feeds
- long lineFeeds; // accumulated lines feeds
- long pagesImaged; // Number of pages imaged.
- long lastYPos; // Used by our RasterDatIn override.
- short curFileRefNum; // refNum of current open file.
- short pixMapRowBytes; // rowBytes of the pixmap we create.
- Rect pixMapBounds; // Bounds of the pixmap we create.
- Fixed hRes; // Horizontal output resolution.
- Fixed vRes; // Vertical output resolution.
- FSSpec fileLocation; // Where to put our files.
- BufferGroupHdl buffer; // all the buffer info
- } DriverGlobals, *DriverGlobalsPtr, **DriverGlobalsHdl;
-
-
-
- DriverGlobalsHdl GetGlobals ( void ) ;
- OSErr CreateGlobals ( void ) ;
- void DisposeGlobals ( void ) ;
-